<?php

require_once 'PipesImpl/Nameable.php';

class Pipes_Value_Template_NameableToControllerName
{
	private $_value = '';

	public function __construct(PipesImpl_Nameable $nameable) {
		$exploded = explode('_', $nameable->getName());
		array_walk($exploded, array($this, '_upperCaseFirst'));
		$this->_value = implode('', $exploded);
	}

	public function __get($key) {
		$return = null;
		if ($key == 'value') {
			$return = $this->_value;
		}

		return $return;
	}

	private function _upperCaseFirst(&$value) {
		$value = ucfirst($value);
	}
}
